package com.lanyuan.controller.system;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lanyuan.a.atest.UserFormMap;
import com.lanyuan.controller.index.BaseController;
import com.lanyuan.util.EhcacheUtils;
import com.lanyuan.util.POIUtils;

@Controller
//@RequestMapping("test")
public class Test extends BaseController {
	
	@RequestMapping("/t1")
	public String exportExcel(HttpServletResponse response) {
		UserFormMap userFormMap = getFormMap(UserFormMap.class);
		List<UserFormMap> list = UserFormMap.mapper().findUserPage(userFormMap);
		POIUtils excelutil = new POIUtils();
		excelutil.exportToExcel(response, "test", list, UserFormMap.class, "test", list.size());
		return null;
	}
	
	
	
	@RequestMapping(value = { "/aaa" }, method = RequestMethod.GET, produces = "application/json ;charset=UTF-8")
	@ResponseBody
	public String aaa(){
		@SuppressWarnings("unchecked")
		Map<String, Object>	mapfield=(Map<String, Object>) EhcacheUtils.get("productinfo");
		System.out.println(mapfield);
		return "aaa";
	}

}
